package cn.iocoder.yudao.module.reading.controller.app.punch.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDate;
import java.util.List;

/**
 * 打卡日历 Response VO
 *
 * @author 芋道源码
 */
@Schema(description = "用户 APP - 打卡日历 Response VO")
@Data
public class PunchCalendarRespVO {

    @Schema(description = "年月", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-01")
    private String yearMonth;

    @Schema(description = "打卡日期列表")
    private List<PunchDayVO> punchDays;

    @Schema(description = "统计信息")
    private PunchStatsVO stats;

    @Schema(description = "打卡日期信息")
    @Data
    public static class PunchDayVO {
        @Schema(description = "日期", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-01-06")
        private LocalDate date;

        @Schema(description = "是否打卡", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
        private Boolean isPunched;

        @Schema(description = "阅读绘本数量", example = "3")
        private Integer bookCount;
    }

    @Schema(description = "打卡统计信息")
    @Data
    public static class PunchStatsVO {
        @Schema(description = "本月打卡天数", requiredMode = Schema.RequiredMode.REQUIRED, example = "15")
        private Integer monthPunchDays;

        @Schema(description = "累计打卡天数", requiredMode = Schema.RequiredMode.REQUIRED, example = "45")
        private Integer totalPunchDays;

        @Schema(description = "当前连续打卡天数", requiredMode = Schema.RequiredMode.REQUIRED, example = "5")
        private Integer currentStreak;

        @Schema(description = "最长连续打卡天数", requiredMode = Schema.RequiredMode.REQUIRED, example = "12")
        private Integer maxStreak;
    }

}
